package com.bsoft.exchange.util;

import com.bsoft.exchange.dao.his.PublicMapper;
import com.bsoft.exchange.dao.portal.HospitalInformationMapper;
import com.bsoft.exchange.domain.*;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 创建日期 : 2019/12/4
 * 创建人 : 赵太行
 */
@Repository
public class CacheSupport {
//    @Cacheable(value ="gyCache",key = "#jgmc")
//    public String getJgmc(String jgid, String jgmc, HospitalInformationMapper hospitalInformationMapper){
//        HospitalInformation hospitalInformation=hospitalInformationMapper.getHospitalById(Long.valueOf(jgid));
//        return hospitalInformation.getOrganizationName();
//    }
    @Cacheable(cacheNames ="ypmcInfo")
    public List<DrugInfo>getDrugInfo(PublicMapper publicMapper){
        return publicMapper.getDrugInfoMapper();
    }
    @Cacheable(cacheNames ="ypcdInfo")
    public List<DrugField>getDrugField(PublicMapper publicMapper){
        return publicMapper.getDrugFieldMapper();
    }
    @Cacheable(value = "ygxmInfo" ,key ="#jgmc" )
    public List<DoctorInfo>getDoctorInfo(String jgid, String jgmc,PublicMapper publicMapper){
        return publicMapper.getYsxm(jgid);
    }
    @Cacheable(cacheNames ="sfxmInfo")
    public List<ChargeProject>getSfxmInfo(PublicMapper publicMapper){
        return publicMapper.getSfxm();
    }
    @Cacheable(value = "ksdmInfo",key = "#jgmc")
    public List<KsdmDomain>getKsdmInfo(String jgid, String jgmc,PublicMapper publicMapper){
        return publicMapper.getKsdm(jgid);
    }
    @Cacheable(cacheNames ="brxzInfo")
    public List<BrxzInfo> getBrxzInfo(PublicMapper publicMapper){
        return publicMapper.getBrxzInfo();
    }

    @Cacheable(value ="jgmcListCache",key = "#jgmc")
    public List<HospitalInformation> getJgmcList(String jgid, String jgmc, HospitalInformationMapper hospitalInformationMapper){
        List<HospitalInformation> hospitalInformation=hospitalInformationMapper.selectList(jgid);
        return hospitalInformation;
    }
}
